package com.demo;

import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.io.IntWritable;
import org.apache.hadoop.mapreduce.Job;
import org.apache.hadoop.mapreduce.lib.input.FileInputFormat;
import org.apache.hadoop.mapreduce.lib.output.FileOutputFormat;

/**
 * Hello world!
 *
 */
public class App 
{
    public static void main( String[] args ) throws Exception
    {
        Configuration conf = new Configuration();
        conf.set("date",args[2]);
        conf.set("timepoint",args[3]);
        Job job = Job.getInstance(conf);

        job.setMapperClass(BaseStationDataPreprocess.Map.class);
        job.setMapOutputKeyClass(IntWritable.class);
        //ָ指定任务的Reducer和输出的数据类型k4 v4
        job.setReducerClass(BaseStationDataPreprocess.Reduce.class);
        job.setOutputKeyClass(IntWritable.class);
        job.setOutputValueClass(IntWritable.class);


        FileInputFormat.setInputPaths(job,new Path(args[0]));
        FileOutputFormat.setOutputPath(job,new Path(args[1]));


        job.waitForCompletion(true);


    }
}
